package com.xingchen.loveparttimejob.model.pojo;

import java.sql.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lwj
 * @date 2024-12-03
 * @vesion 1.0.0
 */
public class JobSchedule {
    /**
     * 时间安排编号
     */
    private int jsId;
    /**
     * 职位编号（外键）
     */
    private int jiId;
    /**
     * 工作开始日期
     */
    private String workStartDate;
    /**
     * 工作结束日期
     */
    private String workEndDate;
    /**
     * 工作时间
     */
    private String workTime;
    /**
     * 工作时段
     */
    private int workPeriod;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 是否删除
     */
    private int state;

    // 构造方法
    public JobSchedule() {}
    public JobSchedule(int jsId, int jiId, String workStartDate, String workEndDate, String workTime, int workPeriod, Date createTime, int state) {
        this.jsId = jsId;
        this.jiId = jiId;
        this.workStartDate = workStartDate;
        this.workEndDate = workEndDate;
        this.workTime = workTime;
        this.workPeriod = workPeriod;
        this.createTime = createTime;
        this.state = state;
    }

    /**
     * 反射中使用到
     * @return
     */
    public Map<String,String> getMapping(){
        Map<String,String> map = new HashMap<>();
        map.put("jsId","js_id");
        map.put("jiId","ji_id");
        map.put("workStartDate","work_start_date");
        map.put("workEndDate","work_end_date");
        map.put("workTime","work_time");
        map.put("workPeriod","work_period");
        map.put("createTime","create_time");
        map.put("state","state");
        return map;
    }


    // 属性
    public int getJsId() {
        return jsId;
    }

    public void setJsId(int jsId) {
        this.jsId = jsId;
    }

    public int getJiId() {
        return jiId;
    }

    public void setJiId(int jiId) {
        this.jiId = jiId;
    }

    public String getWorkStartDate() {
        return workStartDate;
    }

    public void setWorkStartDate(String workStartDate) {
        this.workStartDate = workStartDate;
    }

    public String getWorkEndDate() {
        return workEndDate;
    }

    public void setWorkEndDate(String workEndDate) {
        this.workEndDate = workEndDate;
    }

    public String getWorkTime() {
        return workTime;
    }

    public void setWorkTime(String workTime) {
        this.workTime = workTime;
    }

    public int getWorkPeriod() {
        return workPeriod;
    }

    public void setWorkPeriod(int workPeriod) {
        this.workPeriod = workPeriod;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    /**
     * 打印工作时间表
     * @return
     */
    @Override
    public String toString() {
        return "JobSchedule{" +
                "jsId=" + jsId +
                ", jiId=" + jiId +
                ", workStartDate='" + workStartDate + '\'' +
                ", workEndDate='" + workEndDate + '\'' +
                ", workTime='" + workTime + '\'' +
                ", workPeriod=" + workPeriod +
                ", createTime=" + createTime +
                ", state=" + state +
                '}';
    }
}
